@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css");

/* 基础布局 */
.login-container {
  min-height: 100vh;
  padding: 40px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #7B68EE, #6A5ACD);
  /* 键盘弹出时的调整 */
  padding-bottom: calc(20px + var(--keyboard-height, 0px));
  animation: fadeInUp 0.8s ease-out;
}

/* 头部区域 */
.login-header {
  text-align: center;
  margin-bottom: 30px;
  animation: fadeIn 0.6s ease-out 0.2s both;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
}

.login-logo image {
  width: 60px;
  height: 60px;
  margin-right: 10px;
  animation: logoBounce 0.8s ease-out 0.4s both;
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(90deg, #ffffff, #f0f0f0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* 兼容性处理：如果background-clip不支持，使用白色作为后备 */
  @supports not (background-clip: text) {
    color: #ffffff;
    background: none;
  }
}

.login-title {
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 5px;
  color: #fff;
}

.login-subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

/* 卡片容器 */
.login-card {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 25px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
  animation: slideInUp 0.8s ease-out 0.4s both;
}

/* 表单组 */
.form-group {
  margin-bottom: 20px;
  animation: fadeInUp 0.6s ease-out 0.6s both;
}

.form-group:nth-child(2) {
  animation-delay: 0.7s;
}

.form-group:nth-child(3) {
  animation-delay: 0.8s;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  height: 48px;
  padding: 0 45px 0 45px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  background: #ffffff;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: #7B68EE;
  box-shadow: 0 0 0 2px rgba(123, 104, 238, 0.1);
  transform: translateY(-1px);
}

.form-input::placeholder {
  color: #999;
}

.input-icon {
  position: absolute;
  left: 15px;
  color: #999;
  z-index: 1;
  transition: all 0.25s ease;
}

.form-input:focus + .input-icon {
  color: #7B68EE;
}

.toggle-password {
  position: absolute;
  right: 15px;
  color: #999;
  cursor: pointer;
  transition: all 0.25s ease;
  z-index: 1;
}

.toggle-password:hover {
  color: #7B68EE;
  transform: scale(1.1);
}

.error-message {
  color: #ff4d4f;
  font-size: 12px;
  margin-top: 5px;
  display: block;
  animation: shake 0.5s ease-in-out;
}

/* 表单操作区域 */
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  animation: fadeInUp 0.6s ease-out 0.9s both;
}

.remember-me {
  display: flex;
  align-items: center;
}

.checkbox {
  margin-right: 8px;
  transition: all 0.25s ease;
}

.checkbox:checked {
  transform: scale(1.1);
}

.checkbox-label {
  font-size: 14px;
  color: #666;
}

.forgot-password {
  font-size: 14px;
  color: #7B68EE;
  cursor: pointer;
  transition: all 0.25s ease;
}

.forgot-password:hover {
  color: #6A5ACD;
  transform: translateX(2px);
}

/* 按钮样式 */
.btn-primary {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
  border: none;
  border-radius: var(--border-radius-small);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  animation: fadeInUp 0.6s ease-out 1s both;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--shadow-light);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.btn-primary:active::after {
  width: 300px;
  height: 300px;
}

.loading-icon {
  margin-right: 8px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 分割线 */
.divider {
  position: relative;
  text-align: center;
  margin: 20px 0;
  color: #999;
  font-size: 14px;
  animation: fadeInUp 0.6s ease-out 1.1s both;
}

.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 45%;
  height: 1px;
  background: #e0e0e0;
}

.divider::before {
  left: 0;
}

.divider::after {
  right: 0;
}

.divider text {
  background: var(--bg-card);
  padding: 0 15px;
}

/* 社交登录 */
.social-login {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  animation: fadeInUp 0.6s ease-out 1.2s both;
}

.social-btn {
  flex: 1;
  height: 44px;
  border: 1px solid #e0e0e0;
  border-radius: var(--border-radius-small);
  background: white;
  color: #333;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.social-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-light);
}

.social-btn:active {
  transform: translateY(0);
}

.social-btn.wechat:hover {
  border-color: #07c160;
  color: #07c160;
}

.social-btn.qq:hover {
  border-color: #12b7f5;
  color: #12b7f5;
}

/* 底部链接 */
.login-link {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  animation: fadeInUp 0.6s ease-out 1.3s both;
}

.login-btn {
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  margin-left: 5px;
  position: relative;
}

.login-btn:hover {
  color: #f0f0f0;
  text-decoration: underline;
  transform: translateX(2px);
}

.login-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #fff;
  transition: width 0.3s ease;
}

.login-btn:hover::after {
  width: 100%;
}

/* 动画定义 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { 
    opacity: 0; 
    transform: translateY(30px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

@keyframes slideInUp {
  from { 
    opacity: 0; 
    transform: translateY(50px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

@keyframes logoBounce {
  0% { 
    opacity: 0; 
    transform: scale(0.5) rotate(-180deg); 
  }
  50% { 
    opacity: 1; 
    transform: scale(1.1) rotate(0deg); 
  }
  100% { 
    opacity: 1; 
    transform: scale(1) rotate(0deg); 
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* PC端优化 */
@media screen and (min-width: 1024px) {
  .logo-text {
    /* 确保PC端文字清晰显示 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
  
  .login-title {
    /* 确保PC端标题文字清晰显示 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
  
  .login-subtitle {
    /* 确保PC端副标题文字清晰显示 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
  .login-container {
    padding: 30px 15px 15px;
  }
  
  .login-card {
    padding: 20px;
  }
  
  .login-title {
    font-size: 24px;
  }
  
  .login-subtitle {
    font-size: 13px;
  }
  
  .form-input {
    height: 44px;
  }
  
  .btn-primary {
    height: 44px;
  }
  
  .social-btn {
    height: 40px;
    font-size: 13px;
  }
}

@media screen and (max-width: 480px) {
  .login-container {
    padding: 20px 10px 10px;
  }
  
  .login-card {
    padding: 15px;
  }
  
  .login-logo image {
    width: 50px;
    height: 50px;
  }
  
  .logo-text {
    font-size: 20px;
  }
  
  .login-title {
    font-size: 22px;
  }
  
  .form-input {
    height: 42px;
    font-size: 15px;
  }
  
  .input-icon {
    font-size: 16px;
  }
  
  .toggle-password {
    font-size: 16px;
  }
  
  .btn-primary {
    height: 42px;
    font-size: 15px;
  }
  
  .social-btn {
    height: 38px;
    font-size: 12px;
  }
}